using System;
using System.Collections.Generic;
using System.Xml;
using System.Collections.ObjectModel;

namespace planning
{
	public abstract class Salle : Ressource
	{
		// ----- ATTRIBUTS -----
		private string nom;
        private string type;

		// ----- CONSTRUCTEURS -----
		public Salle()
		{
			// Start of user code for default constructor
			// End of user code for default constructor
		}

		// ----- ACCESSEURS -----
		public string Nom
		{
			get { return nom; }
			set { nom = value; ObjectChanged("nom"); }
		}

        public string TypeSalle
        {
            get { return type; }
            set { type = value; ObjectChanged("type");}
        }


		private static Dictionary<string, Salle> references = new Dictionary<string, Salle>();

		public static new Salle fromXml(XmlNode node)
		{

			Type elementType = Type.GetType("planning." + node.Name);
			if(!typeof(Salle).IsAssignableFrom(elementType))
				throw new InvalidOperationException();

			Salle salle = (Salle) elementType.GetMethod("fromXml").Invoke(null, new object[] { node });
			return salle;
		}

        public abstract string Ref { get; }
	}

}
